* Wealth index calculation. Genevieve Dupuis, 04/04/2019. Uganda MIS 2018-19. *cd 'C:\ug72\wealth'. cd "C:\Users\21180.ICFI\OneDrive - ICF\Projects\Analysis\Wealth Index Construction\UGMIS2018 - v2\wealth". include file='wealth_assets.sps'. missing values QH113N (99.9). execute. set tvars=both. * Macro definitions to perform some recoding automatically. * Note: Do not use an asterisk in front of a macro name to try to comment it out - it will run any way because of the way the macros are expanded. * Delete the line instead or change the spelling of the macro in the comment. * Do not use the names of macros in comments - they will also be expanded too, and likely will fail. *{Create binary variables based on condition and give label }. define dichotomize( !positional !enclose('(',')') / !positional !tokens(1) / !positional !tokens(1) ) compute !2=0. if (!1) !2=1. variable labels !2 !3. value labels !2 0 'No' 1 'Yes'. formats !2 (f1.0). !enddefine. *(Separate shared toilets from non-shared toilets). define shared_fac( !positional !tokens(1) / !positional !tokens(1) / !positional !tokens(1) ). compute !2 = 0. do if (QH106=1). + if (!1=1) !2 = 1. + compute !1 = 0. end if. variable labels !2 !3. value labels !2 0 'No' 1 'Yes'. formats !2 (f1.0). !enddefine. *{Reset missing values to 'does not have', change 2 code to 0}. define no2zero( !positional !tokens(1) ) if (missing(!1) | !1<>1) !1=0. value labels !1 0 'No' 1 'Yes'. !enddefine. *{Construct Variables}. * Source of drinking water. dichotomize (QH101=11) QH101_11 "Source of drinking water: Piped into dwelling". dichotomize (QH101=12) QH101_12 "Source of drinking water: Piped to yard/plot". dichotomize (QH101=13) QH101_13 "Source of drinking water: Piped to neighbor". dichotomize (QH101=14) QH101_14 "Source of drinking water: Public tap/standpipe". dichotomize (QH101=21) QH101_21 "Source of drinking water: Tube well or borehole". dichotomize (QH101=31) QH101_31 "Source of drinking water: Protected well". dichotomize (QH101=32) QH101_32 "Source of drinking water: Unprotected well". dichotomize (QH101=41) QH101_41 "Source of drinking water: Protected spring". dichotomize (QH101=42) QH101_42 "Source of drinking water: Unprotected spring". dichotomize (QH101=51) QH101_51 "Source of drinking water: Rainwater". dichotomize (QH101=61) QH101_61 "Source of drinking water: Tanker truck". dichotomize (QH101=71) QH101_71 "Source of drinking water: Bicycle with jerrycans". dichotomize (QH101=81) QH101_81 "Source of drinking water: Surface water (river/dam/lake/pond/stream/canal/irrigation channel)". dichotomize (QH101=91) QH101_91 "Source of drinking water: Bottled water". dichotomize (QH101=92) QH101_92 "Source of drinking water: Sachet water". dichotomize (QH101=96) QH101_96 "Source of drinking water: Other". * Type of toilet facility. *combined bucket (2 cases) with hanging. dichotomize (QH105=11) QH105_11 "Type of toilet facility: Flush to piped sewer system". dichotomize (QH105=12) QH105_12 "Type of toilet facility: Flush to septic tank". dichotomize (QH105=13) QH105_13 "Type of toilet facility: Flush to pit latrine". dichotomize (QH105=14 or QH105=15) QH105_14 "Type of toilet facility: Flush to somewhere else/don't know where". *ichotomize (QH105=15) QH105_15 "Type of toilet facility: Flush, don't know where". dichotomize (QH105=21) QH105_21 "Type of toilet facility: Ventilated improved pit latrine". dichotomize (QH105=22) QH105_22 "Type of toilet facility: Pit latrine with slab". dichotomize (QH105=23) QH105_23 "Type of toilet facility: Pit latrine without slab/open pit". dichotomize (QH105=31) QH105_31 "Type of toilet facility: Composting toilet". *ichotomize (QH105=41) QH105_41 "Type of toilet facility: Bucket toilet". dichotomize (QH105=51 or QH105 = 41) QH105_51 "Type of toilet facility: Hanging toilet/hanging latrine/bucket toilet". dichotomize (QH105=61) QH105_61 "Type of toilet facility: No facility/bush/field". dichotomize (QH105=96) QH105_96 "Type of toilet facility: Other". shared_fac QH105_11 QH105_11_sh "Type of toilet facility: Flush to piped sewer system - shared". shared_fac QH105_12 QH105_12_sh "Type of toilet facility: Flush to septic tank - shared". shared_fac QH105_13 QH105_13_sh "Type of toilet facility: Flush to pit latrine - shared". shared_fac QH105_14 QH105_14_sh "Type of toilet facility: Flush to somewhere else/don't know where - shared". *hared_fac QH105_15 QH105_15_sh "Type of toilet facility: Flush, don't know where - shared". shared_fac QH105_21 QH105_21_sh "Type of toilet facility: Ventilated improved pit latrine - shared". shared_fac QH105_22 QH105_22_sh "Type of toilet facility: Pit latrine with slab - shared". shared_fac QH105_23 QH105_23_sh "Type of toilet facility: Pit latrine without slab/open pit - shared". shared_fac QH105_31 QH105_31_sh "Type of toilet facility: Composting toilet - shared". *hared_fac QH105_41 QH105_41_sh "Type of toilet facility: Bucket toilet - shared". shared_fac QH105_51 QH105_51_sh "Type of toilet facility: Hanging toilet/hanging latrine/bucket - shared". shared_fac QH105_96 QH105_96_sh "Type of toilet facility: Other - shared". * Type of cooking fuel. *other only has 1 case but... it's other. dichotomize (QH108=1) QH108_1 "Type of cooking fuel: Electricity". dichotomize (QH108=2) QH108_2 "Type of cooking fuel: LPG/cylinder gas". dichotomize (QH108=4) QH108_4 "Type of cooking fuel: Biogas". dichotomize (QH108=5) QH108_5 "Type of cooking fuel: Kerosene". dichotomize (QH108=7) QH108_7 "Type of cooking fuel: Charcoal". dichotomize (QH108=8) QH108_8 "Type of cooking fuel: Wood". dichotomize (QH108=9) QH108_9 "Type of cooking fuel: Straw/shrubs/grass". dichotomize (QH108=10) QH108_10 "Type of cooking fuel: Agricultural crop residue". dichotomize (QH108=11) QH108_11 "Type of cooking fuel: Animal dung". dichotomize (QH108=95) QH108_95 "Type of cooking fuel: No food cooked in household". dichotomize (QH108=96) QH108_96 "Type of cooking fuel: Other". * Local cattle. if (missing(QH111A) | QH110 <> 1) QH111A=0. missing values QH111A (99). compute QH111A_1 = (QH111A >= 1 & QH111A <= 4). compute QH111A_2 = (QH111A >= 5 & QH111A <= 9). compute QH111A_3 = (QH111A >= 10 & QH111A <= 98). variable labels QH111A_1 'Local cattle: 1-4' /QH111A_2 'Local cattle: 5-9' /QH111A_3 'Local cattle: 10+'. * Exotic/cross-breed cattle. if (missing(QH111B) | QH110 <> 1) QH111B=0. missing values QH111B (99). compute QH111B_1 = (QH111B >= 1 & QH111B <= 4). compute QH111B_2 = (QH111B >= 5 & QH111B <= 9). compute QH111B_3 = (QH111B >= 10 & QH111B <= 98). variable labels QH111B_1 'Exotic/cross-breed cattle: 1-4' /QH111B_2 'Exotic/cross-breed cattle: 5-9' /QH111B_3 'Exotic/cross-breed cattle: 10+'. * Horses/donkeys/mules. * ~140 households with any (130 of which have 2), so switching to some/none. if (missing(QH111C) | QH110 <> 1) QH111C=0. missing values QH111C (99). compute QH111C_1 = (QH111C >= 1 & QH111C <= 98). variable labels QH111C_1 'Horses/donkeys/mules: some (1+)'. * Goats. if (missing(QH111D) | QH110 <> 1) QH111D=0. missing values QH111D (99). compute QH111D_1 = (QH111D >= 1 & QH111D <= 4). compute QH111D_2 = (QH111D >= 5 & QH111D <= 9). compute QH111D_3 = (QH111D >= 10 & QH111D <= 98). variable labels QH111D_1 'Goats: 1-4' /QH111D_2 'Goats: 5-9' /QH111D_3 'Goats: 10+'. * Sheep. if (missing(QH111E) | QH110 <> 1) QH111E=0. missing values QH111E (99). compute QH111E_1 = (QH111E >= 1 & QH111E <= 4). compute QH111E_2 = (QH111E >= 5 & QH111E <= 9). compute QH111E_3 = (QH111E >= 10 & QH111E <= 98). variable labels QH111E_1 'Sheep: 1-4' /QH111E_2 'Sheep: 5-9' /QH111E_3 'Sheep: 10+'. * Chickens or other poultry. if (missing(QH111F) | QH110 <> 1) QH111F=0. missing values QH111F (99). compute QH111F_1 = (QH111F >= 1 & QH111F <= 9). compute QH111F_2 = (QH111F >= 10 & QH111F <= 29). compute QH111F_3 = (QH111F >= 30 & QH111F <= 98). variable labels QH111F_1 'Chickens or other poultry: 1-9' /QH111F_2 'Chickens or other poultry: 10-29' /QH111F_3 'Chickens or other poultry: 30+'. * Pigs. * Distribution fits large animal better. if (missing(QH111G) | QH110 <> 1) QH111G=0. missing values QH111G (99). compute QH111G_1 = (QH111G >= 1 & QH111G <= 4). compute QH111G_2 = (QH111G >= 5 & QH111G <= 9). compute QH111G_3 = (QH111G >= 10 & QH111G <= 98). variable labels QH111G_1 'Pigs: 1-4' /QH111G_2 'Pigs: 5-9' /QH111G_3 'Pigs: 10+'. * Number of units for agricultural land. compute landarea = 0. if (QH113U = 1) landarea = QH113N. /* hectare */ if (QH113U = 2) landarea = QH113N*0.404686 . /* Acre = .404686 hectares*/ if (QH113U = 3) landarea = QH113N*0.0015808 . /* poles = .0015808 hectares (16x16 poles = 1 acre) */ if (QH113U = 9 and QH113N = 99.5) landarea = 950. if (QH113U >= 8) landarea = 0. if (missing(QH113N) | QH113N >= 99.8) landarea=999999. if (missing(QH112 ) | QH112 <> 1) landarea=0. missing values landarea (999999). * Electricity. no2zero QH114A. * Radio. no2zero QH114B. * Television. no2zero QH114C. * Telephone (non-mobile). no2zero QH114D. * Computer. no2zero QH114E. * Refrigerator. no2zero QH114F. * Cassette/CD/DVD player. no2zero QH114G. * Table. no2zero QH114H. * Chair. no2zero QH114I. * Sofa set. no2zero QH114J. * Bed. no2zero QH114K. * Cupboard. no2zero QH114L. * Clock. no2zero QH114M. * Watch. no2zero QH115A. * Mobile telephone. no2zero QH115B. * Bicycle. no2zero QH115C. * Motorcycle or scooter. no2zero QH115D. * Animal-drawn cart. no2zero QH115E. * Car or Truck. no2zero QH115F. * Boat with a motor. no2zero QH115G. * Boat without a motor. no2zero QH115H. * Bank account. no2zero QH116. * Main floor material. *combined palm/bamboo (1 case) into wood planks. dichotomize (QH131=11) QH131_11 "Main floor material: Earth/sand". dichotomize (QH131=12) QH131_12 "Main floor material: Dung". dichotomize (QH131=21 or QH131=22) QH131_21 "Main floor material: Wood planks/palm/bamboo". *ichotomize (QH131=22) QH131_22 "Main floor material: Palm/bamboo". *ichotomize (QH131=31) QH131_31 "Main floor material: Parquet or polished wood". dichotomize (QH131=32) QH131_32 "Main floor material: Concrete". dichotomize (QH131=33) QH131_33 "Main floor material: Ceramic tiles". dichotomize (QH131=34) QH131_34 "Main floor material: Cement". dichotomize (QH131=35) QH131_35 "Main floor material: Carpet". dichotomize (QH131=36) QH131_36 "Main floor material: Stones". dichotomize (QH131=37) QH131_37 "Main floor material: Bricks". dichotomize (QH131=96 or QH131=31) QH131_96 "Main floor material: Other/Parquet or polished wood". * Main roof material. *combined cardboard (1 case) into wood planks. *combined roofing shingles (2 cases) into tiles. dichotomize (QH132=11) QH132_11 "Main roof material: No roof". dichotomize (QH132=12) QH132_12 "Main roof material: Thatch/palm leaf". dichotomize (QH132=13) QH132_13 "Main roof material: Mud". dichotomize (QH132=21) QH132_21 "Main roof material: Rustic mat". dichotomize (QH132=22) QH132_22 "Main roof material: Tins". dichotomize (QH132=23 or QH132=24) QH132_23 "Main roof material: Wood planks/cardboard". *ichotomize (QH132=24) QH132_24 "Main roof material: Cardboard". dichotomize (QH132=25) QH132_25 "Main roof material: Tarpaulin". dichotomize (QH132=31) QH132_31 "Main roof material: Iron sheets". dichotomize (QH132=32) QH132_32 "Main roof material: Wood". dichotomize (QH132=33) QH132_33 "Main roof material: Asbestos". dichotomize (QH132=34 or QH132=36) QH132_34 "Main roof material: Tiles/roofing shingles". dichotomize (QH132=35) QH132_35 "Main roof material: Concrete". *ichotomize (QH132=36) QH132_36 "Main roof material: Roofing shingles". dichotomize (QH132=96) QH132_96 "Main roof material: Other". * Main wall material. *combined plywood (3 cases) with reused wood (5 cases). dichotomize (QH133=11) QH133_11 "Main wall material: No walls". dichotomize (QH133=12) QH133_12 "Main wall material: Thatched/straw". dichotomize (QH133=13) QH133_13 "Main wall material: Dirt". dichotomize (QH133=21) QH133_21 "Main wall material: Poles with mud". dichotomize (QH133=22) QH133_22 "Main wall material: Stone with mud". dichotomize (QH133=23) QH133_23 "Main wall material: Unburnt bricks with mud". dichotomize (QH133=24 or QH133=26) QH133_24 "Main wall material: Plywood/reused wood". dichotomize (QH133=25) QH133_25 "Main wall material: Cardboard". *ichotomize (QH133=26) QH133_26 "Main wall material: Reused wood". dichotomize (QH133=27) QH133_27 "Main wall material: Unburnt bricks with plaster". dichotomize (QH133=28) QH133_28 "Main wall material: Burnt bricks with mud". dichotomize (QH133=31) QH133_31 "Main wall material: Cement". dichotomize (QH133=32) QH133_32 "Main wall material: Stone with lime/cement". dichotomize (QH133=33) QH133_33 "Main wall material: Burnt bricks with cement". dichotomize (QH133=34) QH133_34 "Main wall material: Cement blocks". dichotomize (QH133=35) QH133_35 "Main wall material: Unburnt bricks with cement". dichotomize (QH133=36) QH133_36 "Main wall material: Wood planks/shingles". dichotomize (QH133=96) QH133_96 "Main wall material: Other". *{Members per sleeping room}. if (hhusual=0) hhusual=hhslept. if (QH109>0) memsleep=trunc(hhusual/QH109). if (QH109=0) memsleep=hhusual. if (missing(QH109) or QH109>=99 or memsleep>=98) memsleep=99. variable labels memsleep 'Number of members per sleeping room'. value labels memsleep 0 'Less than 1 per room'. formats memsleep (f2.0). missing values memsleep (99). * Compute urban and rural variables coded (1/0) for filters later. *Adding a category for refugee settlements, which weren't coded as urban/rural. compute urban=(QHTYPE = 1). compute rural=(QHTYPE = 2). compute refugee=(QHTYPE=3). variable labels urban 'Urban' / rural 'Rural' / refugee 'Refugee'. value labels urban 1 'Urban' / rural 1 'Rural' / refugee 1 'Refugee'. formats urban rural refugee (f1.0). execute. * Check on indicator variable creation. DROPPED. *frequencies variables=QHTYPE to domestic. * Toilet facility by shared/not shared. crosstabs /tables=QH105 by QH106. * Land area by units - if there are separate units - need to convert them to one unit. *crosstabs /tables=QH113N by QH113U. *DROPPED domestic, house, QH111C_2, QH111C_3, QH105_41, QH105_41_sh, QH108_11, QH131_22, QH132_22, QH132_24, QH132_36, QH133_26. *DROPPED (2) QH105_15, QH131_31. frequencies variables= QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_41 QH101_42 QH101_51 QH101_61 QH101_71 QH101_81 QH101_91 QH101_92 QH101_96 QH105_11 QH105_12 QH105_13 QH105_14 QH105_21 QH105_22 QH105_23 QH105_31 QH105_51 QH105_61 QH105_96 QH105_11_sh QH105_12_sh QH105_13_sh QH105_14_sh QH105_21_sh QH105_22_sh QH105_23_sh QH105_31_sh QH105_51_sh QH105_96_sh QH108_1 QH108_2 QH108_4 QH108_5 QH108_7 QH108_8 QH108_9 QH108_10 QH108_95 QH108_96 QH114A QH114B QH114C QH114D QH114E QH114F QH114G QH114H QH114I QH114J QH114K QH114L QH114M QH115A QH115B QH115C QH115D QH115E QH115F QH115G QH115H QH116 QH131_11 QH131_12 QH131_21 QH131_32 QH131_33 QH131_34 QH131_35 QH131_36 QH131_37 QH131_96 QH132_11 QH132_12 QH132_13 QH132_21 QH132_23 QH132_25 QH132_31 QH132_32 QH132_33 QH132_34 QH132_35 QH132_96 QH133_11 QH133_12 QH133_13 QH133_21 QH133_22 QH133_23 QH133_24 QH133_25 QH133_27 QH133_28 QH133_31 QH133_32 QH133_33 QH133_34 QH133_35 QH133_36 QH133_96 LAND memsleep QH111A_1 QH111A_2 QH111A_3 QH111B_1 QH111B_2 QH111B_3 QH111C_1 QH111D_1 QH111D_2 QH111D_3 QH111E_1 QH111E_2 QH111E_3 QH111F_1 QH111F_2 QH111F_3 QH111G_1 QH111G_2 QH111G_3 landarea . * Turn off weights before all factor analysis. weight off. * Name the dataset window for the HH data for use later. dataset name assets. save outfile='assets.sav'. *** Test Factor Analysis. filter off. execute. *DROPPED domestic, house, QH111C_2, QH111C_3, QH105_41, QH105_41_sh, QH108_11, QH131_22, QH132_22, QH132_24, QH132_36, QH133_26. *DROPPED (2) QH105_15, QH108_96, QH131_31, QH132_96. factor /variables QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_41 QH101_42 QH101_51 QH101_61 QH101_71 QH101_81 QH101_91 QH101_92 QH101_96 QH105_11 QH105_12 QH105_13 QH105_14 QH105_21 QH105_22 QH105_23 QH105_31 QH105_51 QH105_61 QH105_96 QH105_11_sh QH105_12_sh QH105_13_sh QH105_14_sh QH105_21_sh QH105_22_sh QH105_23_sh QH105_31_sh QH105_51_sh QH105_96_sh QH108_1 QH108_2 QH108_4 QH108_5 QH108_7 QH108_8 QH108_9 QH108_10 QH108_95 QH114A QH114B QH114C QH114D QH114E QH114F QH114G QH114H QH114I QH114J QH114K QH114L QH114M QH115A QH115B QH115C QH115D QH115E QH115F QH115G QH115H QH116 QH131_11 QH131_12 QH131_21 QH131_32 QH131_33 QH131_34 QH131_35 QH131_36 QH131_37 QH131_96 QH132_11 QH132_12 QH132_13 QH132_21 QH132_23 QH132_25 QH132_31 QH132_32 QH132_33 QH132_34 QH132_35 QH133_11 QH133_12 QH133_13 QH133_21 QH133_22 QH133_23 QH133_24 QH133_25 QH133_27 QH133_28 QH133_31 QH133_32 QH133_33 QH133_34 QH133_35 QH133_36 QH133_96 LAND memsleep QH111A_1 QH111A_2 QH111A_3 QH111B_1 QH111B_2 QH111B_3 QH111C_1 QH111D_1 QH111D_2 QH111D_3 QH111E_1 QH111E_2 QH111E_3 QH111F_1 QH111F_2 QH111F_3 QH111G_1 QH111G_2 QH111G_3 landarea /missing meansub /analysis QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_41 QH101_42 QH101_51 QH101_61 QH101_71 QH101_81 QH101_91 QH101_92 QH101_96 QH105_11 QH105_12 QH105_13 QH105_14 QH105_21 QH105_22 QH105_23 QH105_31 QH105_51 QH105_61 QH105_96 QH105_11_sh QH105_12_sh QH105_13_sh QH105_14_sh QH105_21_sh QH105_22_sh QH105_23_sh QH105_31_sh QH105_51_sh QH105_96_sh QH108_1 QH108_2 QH108_4 QH108_5 QH108_7 QH108_8 QH108_9 QH108_10 QH108_95 QH114A QH114B QH114C QH114D QH114E QH114F QH114G QH114H QH114I QH114J QH114K QH114L QH114M QH115A QH115B QH115C QH115D QH115E QH115F QH115G QH115H QH116 QH131_11 QH131_12 QH131_21 QH131_32 QH131_33 QH131_34 QH131_35 QH131_36 QH131_37 QH131_96 QH132_11 QH132_12 QH132_13 QH132_21 QH132_23 QH132_25 QH132_31 QH132_32 QH132_33 QH132_34 QH132_35 QH133_11 QH133_12 QH133_13 QH133_21 QH133_22 QH133_23 QH133_24 QH133_25 QH133_27 QH133_28 QH133_31 QH133_32 QH133_33 QH133_34 QH133_35 QH133_36 QH133_96 LAND memsleep QH111A_1 QH111A_2 QH111A_3 QH111B_1 QH111B_2 QH111B_3 QH111C_1 QH111D_1 QH111D_2 QH111D_3 QH111E_1 QH111E_2 QH111E_3 QH111F_1 QH111F_2 QH111F_3 QH111G_1 QH111G_2 QH111G_3 landarea /print univariate initial extraction fscore /criteria factors(1) iterate(25) /extraction pc /rotation norotate /method=correlation. *** Common Factor analysis ***. ** Removed area-specific variables **. ** Agricultural animal variables excluded ** Land area excluded ** Any others ?. *** Common Factor Analysis. filter off. execute. *DROPPED domestic, house, QH105_41, QH105_41_sh, QH108_11, QH131_22, QH132_22, QH132_24, QH132_36, QH133_26. *DROPPED (2) QH105_15, QH108_96, QH131_31, QH132_96. factor /variables QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_41 QH101_42 QH101_51 QH101_61 QH101_71 QH101_81 QH101_91 QH101_92 QH101_96 QH105_11 QH105_12 QH105_13 QH105_14 QH105_21 QH105_22 QH105_23 QH105_31 QH105_51 QH105_61 QH105_96 QH105_11_sh QH105_12_sh QH105_13_sh QH105_14_sh QH105_21_sh QH105_22_sh QH105_23_sh QH105_31_sh QH105_51_sh QH105_96_sh QH108_1 QH108_2 QH108_4 QH108_5 QH108_7 QH108_8 QH108_9 QH108_10 QH108_95 QH114A QH114B QH114C QH114D QH114E QH114F QH114G QH114H QH114I QH114J QH114K QH114L QH114M QH115A QH115B QH115C QH115D QH115E QH115F QH115G QH115H QH116 QH131_11 QH131_12 QH131_21 QH131_32 QH131_33 QH131_34 QH131_35 QH131_36 QH131_37 QH131_96 QH132_11 QH132_12 QH132_13 QH132_21 QH132_23 QH132_25 QH132_31 QH132_32 QH132_33 QH132_34 QH132_35 QH133_11 QH133_12 QH133_13 QH133_21 QH133_22 QH133_23 QH133_24 QH133_25 QH133_27 QH133_28 QH133_31 QH133_32 QH133_33 QH133_34 QH133_35 QH133_36 QH133_96 LAND memsleep /missing meansub /analysis QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_41 QH101_42 QH101_51 QH101_61 QH101_71 QH101_81 QH101_91 QH101_92 QH101_96 QH105_11 QH105_12 QH105_13 QH105_14 QH105_21 QH105_22 QH105_23 QH105_31 QH105_51 QH105_61 QH105_96 QH105_11_sh QH105_12_sh QH105_13_sh QH105_14_sh QH105_21_sh QH105_22_sh QH105_23_sh QH105_31_sh QH105_51_sh QH105_96_sh QH108_1 QH108_2 QH108_4 QH108_5 QH108_7 QH108_8 QH108_9 QH108_10 QH108_95 QH114A QH114B QH114C QH114D QH114E QH114F QH114G QH114H QH114I QH114J QH114K QH114L QH114M QH115A QH115B QH115C QH115D QH115E QH115F QH115G QH115H QH116 QH131_11 QH131_12 QH131_21 QH131_32 QH131_33 QH131_34 QH131_35 QH131_36 QH131_37 QH131_96 QH132_11 QH132_12 QH132_13 QH132_21 QH132_23 QH132_25 QH132_31 QH132_32 QH132_33 QH132_34 QH132_35 QH133_11 QH133_12 QH133_13 QH133_21 QH133_22 QH133_23 QH133_24 QH133_25 QH133_27 QH133_28 QH133_31 QH133_32 QH133_33 QH133_34 QH133_35 QH133_36 QH133_96 LAND memsleep /print univariate initial extraction fscore /criteria factors(1) iterate(25) /extraction pc /rotation norotate /save reg(ALL com) /method=correlation. *** Urban Factor Analysis. filter off. filter by urban. execute. *DROPPED domestic, house, QH111C_2, QH111C_3, QH105_41, QH105_41_sh, QH108_11, QH132_22, QH131_22, QH131_96, QH132_24, QH132_36, QH133_25, QH133_26, QH133_36, QH105_96_sh. *DROPPED (2) QH105_15, QH108_96, QH131_31, QH132_96. factor /variables QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_41 QH101_42 QH101_51 QH101_61 QH101_71 QH101_81 QH101_91 QH101_92 QH101_96 QH105_11 QH105_12 QH105_13 QH105_14 QH105_21 QH105_22 QH105_23 QH105_31 QH105_51 QH105_61 QH105_96 QH105_11_sh QH105_12_sh QH105_13_sh QH105_14_sh QH105_21_sh QH105_22_sh QH105_23_sh QH105_31_sh QH105_51_sh QH108_1 QH108_2 QH108_4 QH108_5 QH108_7 QH108_8 QH108_9 QH108_10 QH108_95 QH114A QH114B QH114C QH114D QH114E QH114F QH114G QH114H QH114I QH114J QH114K QH114L QH114M QH115A QH115B QH115C QH115D QH115E QH115F QH115G QH115H QH116 QH131_11 QH131_12 QH131_21 QH131_32 QH131_33 QH131_34 QH131_35 QH131_36 QH131_37 QH132_11 QH132_12 QH132_13 QH132_21 QH132_23 QH132_25 QH132_31 QH132_32 QH132_33 QH132_34 QH132_35 QH133_11 QH133_12 QH133_13 QH133_21 QH133_22 QH133_23 QH133_24 QH133_27 QH133_28 QH133_31 QH133_32 QH133_33 QH133_34 QH133_35 QH133_96 LAND memsleep QH111A_1 QH111A_2 QH111A_3 QH111B_1 QH111B_2 QH111B_3 QH111C_1 QH111D_1 QH111D_2 QH111D_3 QH111E_1 QH111E_2 QH111E_3 QH111F_1 QH111F_2 QH111F_3 QH111G_1 QH111G_2 QH111G_3 landarea /missing meansub /analysis QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_41 QH101_42 QH101_51 QH101_61 QH101_71 QH101_81 QH101_91 QH101_92 QH101_96 QH105_11 QH105_12 QH105_13 QH105_14 QH105_21 QH105_22 QH105_23 QH105_31 QH105_51 QH105_61 QH105_96 QH105_11_sh QH105_12_sh QH105_13_sh QH105_14_sh QH105_21_sh QH105_22_sh QH105_23_sh QH105_31_sh QH105_51_sh QH108_1 QH108_2 QH108_4 QH108_5 QH108_7 QH108_8 QH108_9 QH108_10 QH108_95 QH114A QH114B QH114C QH114D QH114E QH114F QH114G QH114H QH114I QH114J QH114K QH114L QH114M QH115A QH115B QH115C QH115D QH115E QH115F QH115G QH115H QH116 QH131_11 QH131_12 QH131_21 QH131_32 QH131_33 QH131_34 QH131_35 QH131_36 QH131_37 QH132_11 QH132_12 QH132_13 QH132_21 QH132_23 QH132_25 QH132_31 QH132_32 QH132_33 QH132_34 QH132_35 QH133_11 QH133_12 QH133_13 QH133_21 QH133_22 QH133_23 QH133_24 QH133_27 QH133_28 QH133_31 QH133_32 QH133_33 QH133_34 QH133_35 QH133_96 LAND memsleep QH111A_1 QH111A_2 QH111A_3 QH111B_1 QH111B_2 QH111B_3 QH111C_1 QH111D_1 QH111D_2 QH111D_3 QH111E_1 QH111E_2 QH111E_3 QH111F_1 QH111F_2 QH111F_3 QH111G_1 QH111G_2 QH111G_3 landarea /print univariate initial extraction fscore /criteria factors(1) iterate(25) /extraction pc /rotation norotate /save reg(ALL urb) /method=correlation. *** Rural Factor Analysis. filter off. filter by rural. execute. *DROPPED domestic, house, ,QH111C_2 QH111C_3, QH105_14, QH105_41, QH105_14_sh, QH105_41_sh, QH108_11, QH132_22, QH105_15,QH105_11_sh,QH105_12_sh,QH105_14_sh,QH105_15_sh. *DROPPED QH108_4, QH108_96, QH131_22, QH132_24, QH132_36, QH132_96, QH133_25, QH133_26, QH131_31. factor /variables QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_41 QH101_42 QH101_51 QH101_61 QH101_71 QH101_81 QH101_91 QH101_92 QH101_96 QH105_11 QH105_12 QH105_13 QH105_21 QH105_22 QH105_23 QH105_31 QH105_51 QH105_61 QH105_96 QH105_13_sh QH105_21_sh QH105_22_sh QH105_23_sh QH105_31_sh QH105_51_sh QH105_96_sh QH108_1 QH108_2 QH108_5 QH108_7 QH108_8 QH108_9 QH108_10 QH108_95 QH114A QH114B QH114C QH114D QH114E QH114F QH114G QH114H QH114I QH114J QH114K QH114L QH114M QH115A QH115B QH115C QH115D QH115E QH115F QH115G QH115H QH116 QH131_11 QH131_12 QH131_21 QH131_32 QH131_33 QH131_34 QH131_35 QH131_36 QH131_37 QH131_96 QH132_11 QH132_12 QH132_13 QH132_21 QH132_23 QH132_25 QH132_31 QH132_32 QH132_33 QH132_34 QH132_35 QH133_11 QH133_12 QH133_13 QH133_21 QH133_22 QH133_23 QH133_24 QH133_27 QH133_28 QH133_31 QH133_32 QH133_33 QH133_34 QH133_35 QH133_36 QH133_96 LAND memsleep QH111A_1 QH111A_2 QH111A_3 QH111B_1 QH111B_2 QH111B_3 QH111C_1 QH111D_1 QH111D_2 QH111D_3 QH111E_1 QH111E_2 QH111E_3 QH111F_1 QH111F_2 QH111F_3 QH111G_1 QH111G_2 QH111G_3 landarea /missing meansub /analysis QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_41 QH101_42 QH101_51 QH101_61 QH101_71 QH101_81 QH101_91 QH101_92 QH101_96 QH105_11 QH105_12 QH105_13 QH105_21 QH105_22 QH105_23 QH105_31 QH105_51 QH105_61 QH105_96 QH105_13_sh QH105_21_sh QH105_22_sh QH105_23_sh QH105_31_sh QH105_51_sh QH105_96_sh QH108_1 QH108_2 QH108_5 QH108_7 QH108_8 QH108_9 QH108_10 QH108_95 QH114A QH114B QH114C QH114D QH114E QH114F QH114G QH114H QH114I QH114J QH114K QH114L QH114M QH115A QH115B QH115C QH115D QH115E QH115F QH115G QH115H QH116 QH131_11 QH131_12 QH131_21 QH131_32 QH131_33 QH131_34 QH131_35 QH131_36 QH131_37 QH131_96 QH132_11 QH132_12 QH132_13 QH132_21 QH132_23 QH132_25 QH132_31 QH132_32 QH132_33 QH132_34 QH132_35 QH133_11 QH133_12 QH133_13 QH133_21 QH133_22 QH133_23 QH133_24 QH133_27 QH133_28 QH133_31 QH133_32 QH133_33 QH133_34 QH133_35 QH133_36 QH133_96 LAND memsleep QH111A_1 QH111A_2 QH111A_3 QH111B_1 QH111B_2 QH111B_3 QH111C_1 QH111D_1 QH111D_2 QH111D_3 QH111E_1 QH111E_2 QH111E_3 QH111F_1 QH111F_2 QH111F_3 QH111G_1 QH111G_2 QH111G_3 landarea /print univariate initial extraction fscore /criteria factors(1) iterate(25) /extraction pc /rotation norotate /save reg(ALL rur) /method=correlation. *** Refugee Factor Analysis. filter off. filter by refugee. execute. *DROPPED domestic, house, QH111C_2, QH111C_3, QH105_14, QH105_41, QH105_41_sh, QH108_11, QH132_22, QH101_(11,41,43,71,91,92,96), QH105_(11,14,15,11_sh,12_sh,13_sh,31_sh,51_sh). *DROPPED QH108_(1,2,4,5,96), QH131_21,22,33,37,96), QH115E, QH115G, QH115H, QH132_(11,22,23,24,32,33,34,35,36,96), QH133_(24,26,32,34,36), QH111B_2,QH111B_3,QH111C_1,QH111E_3. *DROPPED QH111F_3, QH111G_2, QH111G_3. *DROPPED (2) QH105_15, QH131_31. factor /variables QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_51 QH101_61 QH101_81 QH105_12 QH105_13 QH105_21 QH105_22 QH105_23 QH105_31 QH105_51 QH105_61 QH105_96 QH105_14_sh QH105_21_sh QH105_22_sh QH105_23_sh QH105_96_sh QH108_7 QH108_8 QH108_9 QH108_10 QH108_95 QH114A QH114B QH114C QH114D QH114E QH114F QH114G QH114H QH114I QH114J QH114K QH114L QH114M QH115A QH115B QH115C QH115D QH115F QH116 QH131_11 QH131_12 QH131_32 QH131_34 QH131_35 QH131_36 QH132_12 QH132_13 QH132_21 QH132_25 QH132_31 QH133_11 QH133_12 QH133_13 QH133_21 QH133_22 QH133_23 QH133_25 QH133_27 QH133_28 QH133_31 QH133_33 QH133_35 QH133_96 LAND memsleep QH111A_1 QH111A_2 QH111A_3 QH111B_1 QH111D_1 QH111D_2 QH111D_3 QH111E_1 QH111E_2 QH111F_1 QH111F_2 QH111G_1 landarea /missing meansub /analysis QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_51 QH101_61 QH101_81 QH105_12 QH105_13 QH105_21 QH105_22 QH105_23 QH105_31 QH105_51 QH105_61 QH105_96 QH105_14_sh QH105_21_sh QH105_22_sh QH105_23_sh QH105_96_sh QH108_7 QH108_8 QH108_9 QH108_10 QH108_95 QH114A QH114B QH114C QH114D QH114E QH114F QH114G QH114H QH114I QH114J QH114K QH114L QH114M QH115A QH115B QH115C QH115D QH115F QH116 QH131_11 QH131_12 QH131_32 QH131_34 QH131_35 QH131_36 QH132_12 QH132_13 QH132_21 QH132_25 QH132_31 QH133_11 QH133_12 QH133_13 QH133_21 QH133_22 QH133_23 QH133_25 QH133_27 QH133_28 QH133_31 QH133_33 QH133_35 QH133_96 LAND memsleep QH111A_1 QH111A_2 QH111A_3 QH111B_1 QH111D_1 QH111D_2 QH111D_3 QH111E_1 QH111E_2 QH111F_1 QH111F_2 QH111G_1 landarea /print univariate initial extraction fscore /criteria factors(1) iterate(25) /extraction pc /rotation norotate /save reg(ALL ref) /method=correlation. * Label the created score variables. rename variables (com1 urb1 rur1 ref1=comscore urbscore rurscore refscore). variable labels comscore 'Common wealth score' /urbscore 'Urban wealth score' /rurscore 'Rural wealth score' /refscore 'Refugee wealth score'. * Add a variable used for linking later. filter off. string rowtype_ (A8). compute rowtype_ = 'EST'. * Calculate regressions. ** Area=urban. filter off. filter by urban. execute. * Declare a dataset to be written to in the regression. dataset declare urbancorv. * Run regression of comscore with urbscore. regression /missing listwise /statistics coeff outs R anova /criteria=pin(.05) pout(.10) /noorigin /dependent comscore /method=enter urbscore /outfile=corv(urbancorv). * Activate file of output from regression. dataset activate urbancorv. * Drop all rows of output except the coefficients. select if (rowtype_ = 'EST'). execute. * Delete unnecessary variables before merging. delete variables DEPVAR_ VARNAME_. * Rename variables containing the constant and the coefficient. rename variables CONST_=urbconst urbscore=urbcoeff. * Re-activate the main household data. dataset activate assets. * merge the coefficients. match files /file = * /table = urbancorv /by ROWTYPE_. execute. * Calculate regressions. ** Area=rural. filter off. filter by rural. execute. * Declare a dataset to be written to in the regression. dataset declare ruralcorv. * Run regression of comscore with rurscore. regression /missing listwise /statistics coeff outs R anova /criteria=pin(.05) pout(.10) /noorigin /dependent comscore /method=enter rurscore /outfile=corv(ruralcorv). * Activate file of output from regression. dataset activate ruralcorv. * Drop all rows of output except the coefficients. select if (rowtype_ = 'EST'). execute. * Delete unnecessary variables before merging. delete variables DEPVAR_ VARNAME_. * Rename variables containing the constant and the coefficient. rename variables CONST_=rurconst rurscore=rurcoeff. * Re-activate the main household data. dataset activate assets. * merge the coefficients. match files /file = * /table = ruralcorv /by ROWTYPE_. execute. * Calculate regressions. ** Area=refugee. filter off. filter by refugee. execute. * Declare a dataset to be written to in the regression. dataset declare refugeecorv. * Run regression of comscore with refscore. regression /missing listwise /statistics coeff outs R anova /criteria=pin(.05) pout(.10) /noorigin /dependent comscore /method=enter refscore /outfile=corv(refugeecorv). * Activate file of output from regression. dataset activate refugeecorv. * Drop all rows of output except the coefficients. select if (rowtype_ = 'EST'). execute. * Delete unnecessary variables before merging. delete variables DEPVAR_ VARNAME_. * Rename variables containing the constant and the coefficient. rename variables CONST_=refconst refscore=refcoeff. * Re-activate the main household data. dataset activate assets. * merge the coefficients. match files /file = * /table = refugeecorv /by ROWTYPE_. execute. dataset close urbancorv. dataset close ruralcorv. dataset close refugeecorv. dataset activate assets. filter off. *** Calculate combined wealth score from Urban and Rural and Refugee Scores. * Use coefficients from urban and rural and refugee regressions above. compute combscor=0. print formats combscor (f11.5). write formats combscor (f11.5). ** Urban. if (urban = 1) combscor=urbconst+urbcoeff*urbscore. ** Rural. if (rural = 1) combscor=rurconst+rurcoeff*rurscore. ** Refugee. if (refugee = 1) combscor=refconst+refcoeff*refscore. variable labels combscor 'Combined national wealth score'. execute. compute hhwt = QHWEIGHT/1000000. variable labels hhwt 'HH weights'. formats hhwt (f12.6). weight by hhwt. filter off. execute. frequencies variables=combscor comscore /format=notable /ntiles=5 /statistics=minimum maximum stddev mean /histogram normal /order=analysis. filter off. filter by urban. execute. frequencies variables=combscor urbscore /format=notable /ntiles=5 /statistics=minimum maximum stddev mean /histogram normal /order=analysis. filter off. filter by rural. execute. frequencies variables=combscor rurscore /format=notable /ntiles=5 /statistics=minimum maximum stddev mean /histogram normal /order=analysis. filter off. filter by refugee. execute. frequencies variables=combscor refscore /format=notable /ntiles=5 /statistics=minimum maximum stddev mean /histogram normal /order=analysis. filter off. execute. *Calculate quintiles and scores for data file. compute hhmemwt=QHWEIGHT*hhusual/1000000. variable labels hhmemwt 'HH members weighting for index'. formats hhmemwt (f12.6). weight by hhmemwt. * Ranking is only for the national total which excludes refugee settlements. compute national = (QHTYPE <> 3). compute national_urb = (national & urban). compute national_rur = (national & rural). execute. * Calculate cutoffs for national total excluding refugees. filter off. filter by national_urb. frequencies variables=urbscore /format=notable /ntiles=5. rank variables=urbscore (A) /rank /ntiles (5) /print=yes /ties=mean. * Create quintiles based on all cases. *filter off. *filter by urban. *do if sysmis(nurbscor). *recode urbscore (lo thru -.9758982 = 1) (-.9758982 thru -.2566641 = 2) (-.2566641 thru .4599145 = 3) (.4599145 thru .9829241 = 4) (.9829241 thru hi = 5) into nurbscor. *end if. filter off. filter by national_rur. frequencies variables=rurscore /format=notable /ntiles=5. rank variables=rurscore (A) /rank /ntiles (5) /print=yes /ties=mean. *filter off. *filter by rural. *do if sysmis(nrurscor). *recode rurscore (lo thru -.6258492 = 1) (-.6258492 thru -.1314661 = 2) (-.1314661 thru .3310823 = 3) (.3310823 thru .9576422 = 4) (.9576422 thru hi = 5) into nrurscor. *end if. *National scores and quintiles. filter off. filter by national. frequencies variables=combscor /format=notable /ntiles=5. rank variables=combscor (A) /rank /ntiles (5) /print=yes /ties=mean. filter off. do if sysmis(ncombsco). recode combscor (lo thru -.6389480 = 1) (-.6389480 thru -.2355721 = 2) (-.2355721 thru .2135719 = 3) (.2135719 thru 1.0241079 = 4) (1.0241079 thru hi = 5) into ncombsco. end if. *Using national cutoffs to give refugees scores - frequencies/rank if only there to create the variable (??). filter off. filter by refugee. frequencies variables=refscore /format=notable /ntiles=5. rank variables=refscore (A) /rank /ntiles (5) /print=yes /ties=mean. filter off. *filter by refugee. *do if sysmis(nrefscor). *recode combscor (lo thru -.6389480 = 1) (-.6389480 thru -.2355721 = 2) (-.2355721 thru .2135719 = 3) (.2135719 thru 1.0241079 = 4) (1.0241079 thru hi = 5) into ncombsco. *end if. variable labels ncombsco 'Combined wealth index' /nurbscor 'Urban wealth index' /nrurscor 'Rural wealth index' /nrefscor 'Refugee wealth index'. value labels ncombsco nurbscor nrurscor nrefscor 1 'Lowest' 2 'Second' 3 'Middle' 4 'Fourth' 5 'Highest'. *** Check on quintiles for national sans refugees. filter national. frequencies variables=ncombsco nurbscor nrurscor nrefscor. filter off. weight by hhwt. *** Check on quintiles. frequencies variables=ncombsco nurbscor nrurscor nrefscor. weight by hhwt. *DROPPED domestic, house, QH111C_2, QH111C_3, QH105_15, QH105_15_sh, QH105_41, QH105_41_sh, QH108_11, QH131_22, QH132_24, QH132_36, QH133_26. *DROPPED (2) QH131_31, QH132_96. ctables /table ( QH101_11+QH101_12+QH101_13+QH101_14+QH101_21+QH101_31+QH101_32+QH101_41+QH101_42+QH101_51+QH101_61+QH101_71+QH101_81+QH101_91+QH101_92+QH101_96+ QH105_11+QH105_12+QH105_13+QH105_14+QH105_21+QH105_22+QH105_23+QH105_31+QH105_51+QH105_61+QH105_96+ QH105_11_sh+QH105_12_sh+QH105_13_sh+QH105_14_sh+QH105_21_sh+QH105_22_sh+QH105_23_sh+QH105_31_sh+QH105_51_sh+QH105_96_sh+ QH108_1+QH108_2+QH108_4+QH108_5+QH108_7+QH108_8+QH108_9+QH108_10+QH108_95+ QH114A+QH114B+QH114C+QH114D+QH114E+QH114F+QH114G+QH114H+QH114I+QH114J+QH114K+QH114L+QH114M+QH115A+QH115B+QH115C+QH115D+QH115E+QH115F+QH115G+QH115H+QH116+ QH131_11+QH131_12+QH131_21+QH131_32+QH131_33+QH131_34+QH131_35+QH131_36+QH131_37+QH131_96+ QH132_11+QH132_12+QH132_13+QH132_21+QH132_22+QH132_23+QH132_25+QH132_31+QH132_32+QH132_33+QH132_34+QH132_35+ QH133_11+QH133_12+QH133_13+QH133_21+QH133_22+QH133_23+QH133_24+QH133_25+QH133_27+QH133_28+QH133_31+QH133_32+QH133_33+QH133_34+QH133_35+QH133_36+ QH133_96+LAND+memsleep+ QH111A_1+QH111A_2+QH111A_3+QH111B_1+QH111B_2+QH111B_3+ QH111C_1+QH111D_1+QH111D_2+QH111D_3+ QH111E_1+QH111E_2+QH111E_3+QH111F_1+QH111F_2+QH111F_3+ QH111G_1+QH111G_2+QH111G_3+landarea )[S][Mean F8.3] by (ncombsco+nurbscor+nrurscor+nrefscor)[C] /slabels visible=no. * Alternative instead of ctables. *means tables= QH101_11 QH101_12 QH101_13 QH101_14 QH101_21 QH101_31 QH101_32 QH101_41 QH101_42 QH101_51 QH101_61 QH101_71 QH101_81 QH101_91 QH101_92 QH101_96 QH105_11 QH105_12 QH105_13 QH105_14 QH105_15 QH105_21 QH105_22 QH105_23 QH105_31 QH105_51 QH105_61 QH105_96 QH105_11_sh QH105_12_sh QH105_13_sh QH105_14_sh QH105_15_sh QH105_21_sh QH105_22_sh QH105_23_sh QH105_31_sh QH105_51_sh QH105_96_sh QH108_1 QH108_2 QH108_4 QH108_5 QH108_7 QH108_8 QH108_9 QH108_10 QH108_95 QH114A QH114B QH114C QH114D QH114E QH114F QH114G QH114H QH114I QH114J QH114K QH114L QH114M QH115A QH115B QH115C QH115D QH115E QH115F QH115G QH115H QH116 QH131_11 QH131_12 QH131_21 QH131_32 QH131_33 QH131_34 QH131_35 QH131_36 QH131_37 QH131_96 QH132_11 QH132_12 QH132_13 QH132_21 QH132_22 QH132_23 QH132_25 QH132_31 QH132_32 QH132_33 QH132_34 QH132_35 QH133_11 QH133_12 QH133_13 QH133_21 QH133_22 QH133_23 QH133_24 QH133_25 QH133_27 QH133_28 QH133_31 QH133_32 QH133_33 QH133_34 QH133_35 QH133_36 QH133_96 LAND memsleep QH111A_1 QH111A_2 QH111A_3 QH111B_1 QH111B_2 QH111B_3 QH111C_1 QH111D_1 QH111D_2 QH111D_3 QH111E_1 QH111E_2 QH111E_3 QH111F_1 QH111F_2 QH111F_3 QH111G_1 QH111G_2 QH111G_3 landarea by ncombsco nurbscor nrurscor nrefscor /cells mean count stddev. graph /histogram(normal)=combscor /title= 'Distribution of Households by Wealth Scores'. frequencies variables=combscor /format=notable /ntiles=5 /statistics=stddev minimum maximum semean mean median mode skewness seskew kurtosis sekurt /order=analysis. weight off. filter off. write formats combscor urbscore rurscore refscore (f11.5). * Save final dataset of assets. save outfile='assets.sav'. *** Write out scores file. write outfile='scores.dat' table /QHCLUST QHNUMBER combscor ncombsco urbscore nurbscor rurscore nrurscor refscore nrefscor. execute. compute reftot = 0. if (QHTYPE = 3) reftot = 1. execute. variable labels reftot 'Refugee settlements'. value labels reftot 0 ' '. filter by national. * Produce table 2.6 weighted by de jure population to test. weight by hhmemwt. compute total = 0. variable labels total 'Total'. value labels total 0 ' '. filter off. ctables /vlabels variables=QHTYPE QHREGION total Ncombsco display=both /table QHTYPE [C] + QHREGION [C] + total [C] + reftot [C] BY Ncombsco [C][rowpct.count '%' F8.1, totals [rowpct.count '%' F8.1, count '' F8.0]] /categories variables=Ncombsco total=yes /titles title='Table 2.6 Wealth Quintiles' '' 'Percent distribution of the de jure population by wealth quintiles, according to residence and region, Uganda MIS 2018-19' corner='Residence/region' /slabels visible=no.